void ShellSort(int* arr, int length)
{
	int gap = length;
	while (gap > 1)
	{
		gap /= 2;
		for (int i=0; i < length - gap; i++)
		{
			int end = i;
			int temp = arr[end + gap];
			while (end >= 0)
			{
				if (temp < arr[end])
				{
					arr[end+gap] = arr[end];
					end -= gap;
				}
				else
				{
					break;
				}
			}
			arr[end+gap] = temp;
		}
	}
}
